package cn.newgrand.netcall.resources;

import java.net.URL;
import java.util.PropertyResourceBundle;
import java.util.ResourceBundle;

import javax.swing.ImageIcon;

public class ExpertRes {
	
	private static PropertyResourceBundle prb = null;
	public static final String EXPERT_IMAGE = "EXPERT_IMAGE";
	public static final String LOOK_LEAVEWORD_IMAGE = "LOOK_LEAVEWORD_IMAGE";
	static ClassLoader cl = ExpertRes.class.getClassLoader();
	private ExpertRes(){
		
	}
	
	static{
		prb = (PropertyResourceBundle)ResourceBundle.getBundle("expert");
	}
	
	public static final ImageIcon getImageIcon(String imageName){
		
		try {
			final String imageURI = prb.getString(imageName);
			final URL imageURL = cl.getResource(imageURI);
			return new ImageIcon(imageURL);
		} catch (Exception e) {
			System.out.println(imageName + " not found.");
		}
		return null;
	}
	
	public static void main(String[] args) {
		ExpertRes.getImageIcon("EXPERT_IMAGE");
	}

}
